package com.ecreditpal.audio.tencentVoiceDemo;
import cn.xsshome.taip.speech.TAipSpeech;
import cn.xsshome.taip.util.FileUtil;

import java.io.IOException;


public class TencentDemo {
    public static void main(String[] args) {
        TAipSpeech tAipSpeech=new TAipSpeech("1106902183","xA1wzcIHWzBbrWR2");
        byte[] audio;
        int format=2;
        int rate=16000;
        {
            try {
                audio = FileUtil.readFileByBytes("/Users/xuebinxu/Downloads/pp2.wav");
                String result=tAipSpeech.asrEcho(audio,format,rate);
                System.out.println(result);
            } catch (IOException e) {
                e.printStackTrace();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

}
